/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cluster

import (
	"github.com/rs/zerolog/log"
	"github.com/spf13/cobra"
	"satellite/app/cluster"
)

// showCmd represents the showCmd command
var showCmd = &cobra.Command{
	Use:   "show",
	Short: "watch cluster status",
	Long:  ``,
	Args:  Args,
	Run: func(cmd *cobra.Command, args []string) {
		runner := cluster.NewShow(showOption).WithBase(base)
		err := runner.Run()
		if err != nil {
			log.Warn().Err(err).Send()
			return
		}
	},
}

var (
	showOption = new(cluster.ShowOption)
)

func init() {
	clusterCmd.AddCommand(showCmd)
	showCmd.Flags().BoolVarP(&showOption.EnableCondition, "condition", "c", false, "")
	showCmd.Flags().BoolVarP(&showOption.EnableSpec, "spec", "s", false, "")
	showCmd.Flags().BoolVarP(&showOption.EnableAnnotation, "annotation", "a", false, "")
	showCmd.Flags().BoolVarP(&showOption.EnableLabel, "label", "l", false, "")
	showCmd.Flags().BoolVarP(&showOption.EnableFinalizer, "finalizer", "f", false, "")
	showCmd.Flags().BoolVarP(&showOption.EnableWatch, "watch", "w", false, "启用资源观察模式")
}
